home *** CD-ROM | disk | FTP | other *** search
- Path: alpha2.csd.uwm.edu!mardavuy
- From: mardavuy@alpha2.csd.uwm.edu (Mario David Uy)
- Newsgroups: comp.lang.c
- Subject: What is wrong with this loop?
- Date: 19 Apr 1996 14:06:34 GMT
- Organization: Information & Media Technologies, University of Wisconsin - Milwaukee
- Distribution: world
- Message-ID: <4l86la$1t9@uwm.edu>
- NNTP-Posting-Host: 129.89.169.2
-
- #include <stdio.h>
- int main(void)
- {
- int dia;
-
- char cd;
-
- ...
-
- scanf("%c", &cd);
- while (cd != 'm' || cd ! 'f' || cd != 'o')
- {
- printf("Re-enter m, f, or o.\n");
- scanf(%c", &cd);
- }
- ...
- }
-
- It works fine, except that it gives me the printf() twice.
-
- David
- mardavuy@csd.uwm.edu
- --
- -------------------------------------------------------------------------------
- || ||Is it gonna be hide or seek, ||
- || Mario David Uy || is it gonna be win or lose? ||
- || mardavuy@csd.uwm.edu ||Is it gonna be pride that keeps||
-